import request from "@/router/axios";

// 分页查询价格组列表
export function priceGroupFetchList(query) {
  return request({
    url: "/eims/priceGroup/page",
    method: "get",
    params: query
  });
}
// 列表查询价格组类别
export function getGroupList() {
  return request({
    url: "/eims/priceGroup/list",
    method: "get"
  });
}

// 价格组新增
export function priceGroupAddObj(obj) {
  return request({
    url: "/eims/priceGroup",
    method: "post",
    data: obj
  });
}

// 通过ID查询价格组
export function priceGroupGetObj(id) {
  return request({
    url: "/eims/priceGroup/" + id,
    method: "get"
  });
}

// 价格组删除
export function priceGroupDelObj(id) {
  return request({
    url: "/eims/priceGroup/" + id,
    method: "delete"
  });
}

// 价格组修改
export function priceGroupPutObj(obj) {
  return request({
    url: "/eims/priceGroup",
    method: "put",
    data: obj
  });
}

// 停用/启用价格组
export function enableOrStopPriceGroupObj(obj) {
  return request({
    url: "/eims/priceGroup/updateStatus",
    method: "put",
    data: obj
  });
}

// 根据部门id获取价格组关联部门信息
export function getPriceGroupByDeptId(deptId) {
  return request({
    url: "/eims/priceDeptGroup/getPriceGroup/" + deptId,
    method: "get"
  });
}


// 根据价格组id获取关联部门id
export function getPriceGroupByGroupId(groupId) {
  return request({
    url: "/eims/priceDeptGroup/getPriceGroupByGroupId/" + groupId,
    method: "get"
  });
}

